home *** CD-ROM | disk | FTP | other *** search
- /* Programm: ImageTest.c
- * Autor: Rainer Zeitler
- * Kreiert zwei Image-Objekte
- * Compiler: SAS-C
- * Aufruf: lc -L ImageTest.c
- */
-
- #include <exec/types.h>
- #include <intuition/intuition.h>
- #include <intuition/gadgetclass.h>
- #include <intuition/imageclass.h>
- #include <clib/exec_protos.h>
- #include <clib/intuition_protos.h>
-
- struct Library *IntuitionBase;
- struct Window *MyWindow;
- struct Gadget *downgadget, *upgadget;
- struct Image *imageup, *imagedown;
- /* Parameter fürs Öffnen des Fensters */
- struct TagItem WindowTags[] = {
- WA_Flags, WFLG_DEPTHGADGET | WFLG_DRAGBAR,
- WA_IDCMP, 0, WA_Height, 200, WA_Width, 300,
- WA_Title, (ULONG)"Image-Test", TAG_END,0
- };
- void main(void) {
- struct DrawInfo *drawinfo;
- /* Öffnen der Library (mind. V37) */
- IntuitionBase=OpenLibrary("intuition.library",37);
- if( IntuitionBase ) {
- MyWindow = OpenWindowTagList(NULL,WindowTags);
- if( MyWindow ) {
- /* DrawInfo holen */
- drawinfo=GetScreenDrawInfo(MyWindow->WScreen);
- /* Einrichten des Images */
- imageup=(struct Image *)NewObject( NULL,
- "sysiclass",
- SYSIA_Size, SYSISIZE_MEDRES, /* Hires */
- SYSIA_Which, UPIMAGE, /* Pfeil hoch */
- SYSIA_DrawInfo, drawinfo,
- TAG_END);
- if( imageup ) {
- imagedown=(struct Image *)NewObject( NULL,
- "sysiclass",
- SYSIA_Size, SYSISIZE_MEDRES,
- SYSIA_Which, DOWNIMAGE, /* Pfeil runter */
- SYSIA_DrawInfo, drawinfo,
- TAG_END);
- if( imagedown ) {
- downgadget=(struct Gadget *)NewObject(NULL,
- "buttongclass", GA_IMAGE, imagedown,
- GA_LEFT, 20, GA_TOP, 20, GA_ID, 1,
- TAG_END );
- if( downgadget ) {
- upgadget=(struct Gadget *)NewObject(NULL,
- "buttongclass", GA_IMAGE, imageup,
- GA_LEFT, 50, GA_TOP, 20,
- GA_ID, 2, GA_Previous, downgadget,
- TAG_END );
- if( upgadget ) {
- AddGList( MyWindow, downgadget, -1 );
- RefreshGList(downgadget,MyWindow,
- NULL,-1);
- /* Etwas warten */
- Delay( 5 * 50 );
- DisposeObject( upgadget );
- }
- DisposeObject( downgadget );
- }
- DisposeObject( imagedown );
- }
- DisposeObject( imageup );
- }
- FreeScreenDrawInfo(MyWindow->WScreen,drawinfo);
- CloseWindow(MyWindow);
- }
- CloseLibrary(IntuitionBase);
- }
- }
-